package com.sita.bike.rest.model;


import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by xiaodong on 15/9/22.
 *//*
@XmlRootElement(name = "trip")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "trip", propOrder = {
        "id",
        "deviceId",
        "fromTime",
        "arriveTime",
        "locations"
})
@JsonPropertyOrder(value = {
        "id",
        "vehicleId",
        "fromTime",
        "arriveTime",
        "locations"
})*/
public class Trip implements Serializable {
    private final static long serialVersionUID = 1L;
    private Long id;

//    @Override
//    public String toString() {
//        return "Trip{" +
//                "id=" + id +
//                ", deviceId=" + deviceId +
//                ", fromTime='" + fromTime + '\'' +
//                ", arriveTime='" + arriveTime + '\'' +
//                ", locations=" + locations +
//                '}';
//    }

    private Long deviceId;

    private String fromTime;

    private String arriveTime;

    // @XmlElementWrapper(name = "locations")
    //  @XmlElement(name = "location")
    protected List<Location> locations;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(Long deviceId) {
        this.deviceId = deviceId;
    }

    public String getFromTime() {
        return fromTime;
    }

    public void setFromTime(String fromTime) {
        this.fromTime = fromTime;
    }

    public String getArriveTime() {
        return arriveTime;
    }

    public void setArriveTime(String arriveTime) {
        this.arriveTime = arriveTime;
    }

    // @JsonProperty(value = "locations")
    public List<Location> getLocations() {
        if (locations == null) {
            locations = new ArrayList<Location>();
        }
        return locations;
    }

    public void setLocations(List<Location> locations) {
        this.locations = locations;
    }

}
